// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

LL x, y;

// pair<LL, LL> doit()

LL ansa, ansb;

bool try2(LL x, LL y) {
    LL z = y - x;
    if (z < 0 || z & 1) {
        puts("-1");
        return 0;
    }
    z = z / 2;
    LL unit = 1;
    ansa = 0, ansb = 0;
    if (x & z)
        return 0;
    for (int i=0; i<63; ++i) {
        int va = (x >> i) & 1, vb = (z >> i) & 1;
        // dbg(i, va, vb);
        if (va == 0 && vb == 0) {

        } else if (va == 1 && vb == 0) {
            ansb += unit;
        } else if (va == 0 && vb == 1) {
            ansa += unit;
            ansb += unit;
        } else if (va == 1 && vb == 1)
            return false;
        unit <<= 1;
    }
    assert(ansa + ansb == y);
    assert(ansa ^ ansb == x);
    return true;
}

int main(int argc, char const *argv[]) {
    // code
    cin >> x >> y;
    if (x == y) {
        if (x == 0)
            puts("0");
        else
            printf("1\n%lld\n", x);
        return 0;
    }
    if (x > y) {
        puts("-1");
        return 0;
    }
    if ((x&1) != (y&1)) {
        puts("-1");
        return 0;
    }
    if (try2(x, y)) {
        printf("2\n%lld %lld\n", ansa, ansb);
        return 0;
    }
    LL a = x, b = (y-x)/2;
    printf("3\n%lld %lld %lld\n", a, b, b);
    assert(a+b+b == y);
    assert(a^b^b == x);
    // puts("-1");
    // printf("%lld %lld\n", ansa, ansb);
    // dbg(ansa ^ ansb, ansa + ansb);
    return 0;
}
